package com.zx.dao;

/**
 * 打印机程序
 * 面向接口编程
 */
public class PrintText {
    Ink ink = null;
    Paper paper = null;

    public void print(String message) {
        System.out.println("使用" + ink.getColor(250, 200, 2) + "打印");

        for (int i = 0; i < message.length(); i++) {
            paper.putInChar(message.charAt(i));
        }
        System.out.println(paper.getContext());
    }

    public void setInk(Ink ink) {
        this.ink = ink;
    }

    public void setPaper(Paper paper) {
        this.paper = paper;
    }
}
